import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (params) => {
  return request.get('/sys/role', { params })
}

// 添加角色
export const addRole = (data) => {
  return request.post('/sys/role', data)
}

// 修改角色
export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 修删除色
export const delRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}

export const getRoleDetail = id => {
  return request.get(`/sys/role/${id}`)
}

export const assignPerm = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
